package com.wangsd.web.report.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 服务商配置
 */
@Data
@Entity
@Table(name = "service_business")
@ApiModel(value = "服务商", description = "服务商配置信息")
public class ServiceBusiness implements Serializable {

    /**
     * 服务商基本信息
     */
    @ApiModelProperty(value = "服务商名称")
    private String name;
    @ApiModelProperty(value = "厂商ID")
    private Long manufacturerId;
    @ApiModelProperty(value = "检索标识")
    private String code;
    @ApiModelProperty(value = "服务商手机号码")
    private String phone;
    @ApiModelProperty(value = "账户剩余金额（元）")
    @Column(name = "total_fee",columnDefinition = "double(10, 2) NOT NULL DEFAULT 0.00")
    private Double totalFee;
    @ApiModelProperty(value = "上报费率")
    @Column(name = "report_rate",columnDefinition = "double(5, 4) NOT NULL DEFAULT 0.00")
    private Double reportRate;
    /**
     * 服务商微信配置
     */
    @ApiModelProperty(value = "微信APPID")
    private String wxAppId;
    @ApiModelProperty(value = "微信商户号")
    private String wxMchId;
    @ApiModelProperty(value = "微信商户密钥")
    private String wxMchKey;

    /**
     * 以下是通用字段
     */
    @Id
    @TableId(type = IdType.AUTO)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createdTime;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updatedTime;

    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;


    @ApiModelProperty(value = "厂商名称")
    @Transient
    @TableField(exist = false)
    private String manufacturerName;
}
